/**
 * Created by luojie on 2018/3/12.
 * 路由模块配置。
 */
import Bundle from "./bundle";


import IndexComp from "bundle-loader?lazy&name=app-[name]!../pages/home";
import AboutUs from "bundle-loader?lazy&name=app-[name]!../pages/aboutUs";
import Business from "bundle-loader?lazy&name=app-[name]!../pages/business";
import SquareInfo from "bundle-loader?lazy&name=app-[name]!../pages/squareInfo";
let arr = [
	{ key: "index", comp: IndexComp, path: "/index" },
	{ key: "aboutUs", comp: AboutUs, path: "/aboutUs" },
	{ key: "business", comp: Business, path: "/business" },
	{ key: "squareInfo", comp: SquareInfo, path: "/squareInfo/:id" },

];

let Modules = [];
arr.forEach((item) => {
	let obj = {};
	obj["comp"] = (props) => (
		<Bundle {...props} load={item.comp}>
			{(Comps) => <Comps {...props} />}
		</Bundle>
	);
	obj["path"] = item.path;
	Modules.push(obj);
});



export { Modules}